import { defineConfig } from "eslint/config";
import nodePlugin from "eslint-plugin-n";
import js from "@eslint/js";

export default defineConfig([
  // Node.js recommended configuration
  js.configs.recommended,
  nodePlugin.configs["flat/recommended"],
  // Custom rules
  {
    rules: {
      "n/exports-style": ["error", "module.exports"],
      "no-unused-vars": "warn",
      "no-undef": "warn",
      "n/no-unpublished-import": "off",
    },
    ignores: ["node_modules", "vue-project"],
  },
  {
    files: ["**/*.mjs"], // 显式 ESM 文件
    languageOptions: {
      ecmaVersion: "latest",
      sourceType: "module",
    },
  },
]);
